/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MainClasses.Event;

import MainClasses.*;
/**
 *
 * @author andrewcutler
 */
public class SchoolEvent extends CheckableEvent{

    private Course course;
    
    public SchoolEvent(int type)                                 { super(type); }
    public SchoolEvent(int type, String name)                      { super(type, name); }
    public SchoolEvent(int type, String name, String description)  { super(type, name, description); }
    
    public EventPanel getPanel()
    {
        if(this.getType() == Event.HOMEWORK || this.getType() == Event.PROJECT)
            return new EventCheckPanel(this);
        if(this.getType() == Event.CLASSWORK || this.getType() == Event.TEST)
            return new StandardPanel(this);
        
        return null;
    }
    
    public void setCourse(Course c)    { course = c;    }
    public Course getCourse()          { return course; }
    
    @Override
    public String getUniqueID() {
        return Event.typeStrings[getType()]+":::"
                +course.getCourseName()+":::"
                +course.getTeacher()+":::"
                +getEndDate().toString(MainClasses.MyDate.FORMAT_2, "-")+":::"
                +getStartDate().toString(MyDate.FORMAT_2, "-")+":::"
                +this.getName();
    }

}
